/*
 * @Descripttion: 
 * @version: 
 * @Author: mmzhang
 * @Date: 2021-07-23 11:03:01
 * @LastEditTime: 2022-11-09 11:23:16
 */
import table from '@/components/dt/table/render.js'

let _this = null;

const sendThis = (vm) => {
  _this = vm;
};
export default {
  sendThis,
  columns: [{
    title: '区域/子公司',
    field: 'orgEndName',
    minWidth: 250,
    fixed: 'left',
    treeNode: true
  },
  {
    title: '合作模式',
    field: 'coopMode',
    minWidth: 180,
    cell: {
      text: {
        type: 'dict',
        key: 'cooperationModeAttrSort'
      }
    }
  },
  {
    title: '开发商简称',
    field: 'developerAbbreviation',
    minWidth: 180
  },
  {
    title: '成本中心',
    field: 'costCenter',
    minWidth: 300
  },
  {
    title: '产品类型',
    field: 'productType',
    minWidth: 180,
    cell: {
      text: {
        type: 'dict',
        key: 'productType'
      }
    }
  },
  {
    title: '新来人',
    field: 'newComer',
    minWidth: 130,
    cell: {
      text: {
        type: 'number',
        fixed: 0
      }
    }
  },
  {
    title: '来人',
    field: 'comer',
    minWidth: 130,
    cell: {
      text: {
        type: 'number',
        fixed: 0
      }
    }
  },
  {
    title: '认购',
    field: 'subscribe',
    align: 'center',
    children: [{
      title: '套数',
      field: 'subscribe',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.subscribe.quantity,
            event: 'linkOrderSummaryFun',
            data: [0, 0, params.row, 0],
            type:'number',
            fixed: 0
          })
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'subscribe',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.subscribe.area,
            event: 'linkOrderSummaryFun',
            data: [0, 1, params.row, 0],
            type:'number'
          })
        }
      }
    },
    {
      title: '认购金额（元）',
      field: 'subscribe',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.subscribe.amount,
            event: 'linkOrderSummaryFun',
            data: [0, 2, params.row, 0],
            type:'number'
          })
        }
      }
    }]
  },
  {
    title: '退购',
    align: 'center',
    field: 'retreatSubscribe',
    children: [{
      title: '套数',
      field: 'retreatSubscribe',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.retreatSubscribe.quantity,
            event: 'linkOrderSummaryFun',
            data: [0, 0, params.row, 1],
            type:'number',
            fixed: 0
          })
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'retreatSubscribe',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.retreatSubscribe.area,
            event: 'linkOrderSummaryFun',
            data: [0, 1, params.row, 1],
            type:'number'
          })
        }
      }
    },
    {
      title: '退购金额（元）',
      field: 'retreatSubscribe',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.retreatSubscribe.amount,
            event: 'linkOrderSummaryFun',
            data: [0, 2, params.row, 1],
            type:'number'
          })
        }
      }
    }]
  },
  {
    title: '认购调整',
    align: 'center',
    field: 'subscribeAdjustment',
    children: [
    {
      title: '调整面积（㎡）',
      field: 'subscribeAdjustment.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '调整金额（元）',
      field: 'subscribeAdjustment.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  },
  {
    title: '认购净值',
    align: 'center',
    field: 'subscribeNetWorth',
    children: [{
      title: '套数',
      field: 'subscribeNetWorth.quantity',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
          fixed: 0
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'subscribeNetWorth.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '认购金额（元）',
      field: 'subscribeNetWorth.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  },
  {
    title: '实际认购净值',
    field: 'actualSubscribeNetWorth',
    align: 'center',
    children: [{
      title: '套数',
      field: 'actualSubscribeNetWorth.quantity',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
          fixed: 0
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'actualSubscribeNetWorth.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '认购金额（元）',
      field: 'actualSubscribeNetWorth.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  },
  {
    title: '签约',
    align: 'center',
    field: 'contract',
    children: [{
      title: '套数',
      field: 'contract',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.contract.quantity,
            event: 'linkOrderSummaryFun',
            data: [1, 0, params.row, 2],
            type:'number',
            fixed: 0
          })
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'contract',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.contract.area,
            event: 'linkOrderSummaryFun',
            data: [1, 1, params.row, 2],
            type:'number'
          })
        }
      }
    },
    {
      title: '签约金额（元）',
      field: 'contract',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.contract.amount,
            event: 'linkOrderSummaryFun',
            data: [1, 2, params.row, 2],
            type:'number'
          })
        }
      }
    }]
  },
  {
    title: '退签',
    align: 'center',
    field: 'retreatContract',
    children: [{
      title: '套数',
      field: 'retreatContract',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.retreatContract.quantity,
            event: 'linkOrderSummaryFun',
            data: [1, 0, params.row, 3],
            type:'number',
            fixed: 0
          })
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'retreatContract',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.retreatContract.area,
            event: 'linkOrderSummaryFun',
            data: [1, 1, params.row, 3],
            type:'number'
          })
        }
      }
    },
    {
      title: '退签金额（元）',
      field: 'retreatContract',
      minWidth: 150,
      slots: {
        default: (params, h) => {
          return table.cell.btn(_this, h, {
            title: params.row.retreatContract.amount,
            event: 'linkOrderSummaryFun',
            data: [1, 2, params.row, 3],
            type:'number'
          })
        }
      }
    }]
  },
  {
    title: '签约调整',
    align: 'center',
    field: 'contractAdjustment',
    children: [
    {
      title: '调整面积（㎡）',
      field: 'contractAdjustment.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '调整金额（元）',
      field: 'contractAdjustment.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  },
  {
    title: '签约净值',
    align: 'center',
    field: 'contractNetWorth',
    children: [{
      title: '套数',
      field: 'contractNetWorth.quantity',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
          fixed: 0
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'contractNetWorth.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '签约金额（元）',
      field: 'contractNetWorth.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  },
  {
    title: '认购未签约',
    align: 'center',
    field: 'notContract',
    children: [{
      title: '套数',
      field: 'notContract.quantity',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
          fixed: 0
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'notContract.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '认购金额（元）',
      field: 'notContract.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  },
  {
    title: '平均签约单价（元）',
    field: 'avgContractUnitPrice',
    minWidth: 170,
    cell: {
      text: {
        type: 'number',
      }
    }
  },
  {
    title: '平均签约总价（元）',
    field: 'avgContractTotalPrice',
    minWidth: 170,
    cell: {
      text: {
        type: 'number',
      }
    }
  },
  {
    title: '当前可售房源',
    align: 'center',
    field: 'availableRoom',
    children: [{
      title: '套数',
      field: 'availableRoom.quantity',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
          fixed: 0
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'availableRoom.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '表总价（元）',
      field: 'availableRoom.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  },
  {
    title: '累计认购未签约',
    align: 'center',
    field: 'cumulateNotContract',
    children: [{
      title: '套数',
      field: 'cumulateNotContract.quantity',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
          fixed: 0
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'cumulateNotContract.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '签约金额（元）',
      field: 'cumulateNotContract.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  },
  {
    title: '本年签约净值',
    align: 'center',
    field: 'yearContractNetWorth',
    children: [{
      title: '套数',
      field: 'yearContractNetWorth.quantity',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
          fixed: 0
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'yearContractNetWorth.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '签约金额（元）',
      field: 'yearContractNetWorth.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  },
  {
    title: '累计签约净值',
    align: 'center',
    field: 'cumulateContractNetWorth',
    children: [{
      title: '套数',
      field: 'cumulateContractNetWorth.quantity',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
          fixed: 0
        }
      }
    },
    {
      title: '面积（㎡）',
      field: 'cumulateContractNetWorth.area',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    },
    {
      title: '签约金额（元）',
      field: 'cumulateContractNetWorth.amount',
      minWidth: 150,
      cell: {
        text: {
          type: 'number',
        }
      }
    }]
  }],
}